import time

from LongUI.page.login_page import LoginPage
from selenium.webdriver.common.by import By

class ZhPage(LoginPage):
    # 断言系统菜单
    dy1_loc = By.XPATH, '//*[@id="sidebar"]/div[1]/h2'
    def dy1(self):
        return self.text(self.dy1_loc)

    # 点击账户管理
    zh_loc=By.XPATH,'/html/body/div[1]/div[2]/div[2]/div[2]/div[3]/h2'
    def zh(self):
        self.click(self.zh_loc)

    # 点击账户信息
    information_loc=By.XPATH,'//*[@id="sidebar"]/div[2]/div[4]/ul/li[1]/div/a'
    def information(self):
        self.click(self.information_loc)

    # 输入账户编码
    zhid_loc=By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input'
    def zhid(self):
        self.send_keys(self.zhid_loc,'91983415495485788162')

    # 点击查询
    zhcx_loc=(By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/div/div/button')
    def zhcx(self):
        self.click(self.zhid_loc)

    def zhpage(self):
        self.longguo_login()
        print(self.dy1())
        assert '系统菜单' == self.dy1()
        self.zh()
        time.sleep(1)
        self.information()
        self.zhid()
        self.zhcx()